﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FaceRecognition.View;
using System.Windows.Forms;
using System.Drawing;
using System.ComponentModel;
using System.Data;
using Emgu.CV;
using Emgu.CV.Structure;
using Emgu.CV.CvEnum;
using System.Drawing.Drawing2D;
using System.Text.RegularExpressions;
using System.Net;
using System.Net.Sockets;
using FaceRecognition.DataBase;

namespace FaceRecognition.Models
{
    class Controller_Class
    {



        private User_Manager user;

        public User_Manager User
        {
            get { return user; }
           
        }
        private Train_manager train;

        public Train_manager Train
        {
            get { return train; }
            
        }
        public Controller_Class()
        {
            user = new User_Manager();
            train = new Train_manager();
        }
        
        public void open_image()
        {
            OpenFileDialog Openfile = new OpenFileDialog();
            if (Openfile.ShowDialog() == DialogResult.OK)
            {
                Image<Bgr, Byte> My_Image = new Image<Bgr, byte>(Openfile.FileName);
                //  pictureBox1.Image = My_Image.ToBitmap();

            }
        }
        
        
      
        
       
       

        
       
       
        public List<string> retrive_feature_by_email(string email)
        {
            ////// undone
            if (user == null)
                user = new User_Manager();
            if (train == null)
                train = new Train_manager();

            List<string> all_features = new List<string>();
            try
            {
                Int32 id = user.ID_retrival_by_email(email);
                all_features = train.retrive_features_of_certain_id(id);
                return all_features;
            }
            catch (Exception e)
            {
                throw e;
            }
        }
       
        }






    }

